/*
 *  IMIBaseAppHelper.h
 *  IMIBase
 *
 *  Created by Travis on 09-7-12.
 *  Copyright 2009 imi.im All rights reserved.
 *
 */
#import "IMIBasePrefix.h"

@interface UIApplication (IMIBase)

/** show current project version number on screen */
+ (void) showVersion;

/** return app main bundle path as nsstring */
+ (NSString*) appDir;

/** return app documents folder path as nsstring */
+ (NSString*) docDir;

@end

#define AppSetting [NSUserDefaults standardUserDefaults]
#define AppDir [UIApplication appDir]
#define DocDir [UIApplication docDir]


/** return the full path of file in folder
 *	arguments:
 *		name: file name
 *		folder: the folder of file
 */
IMIDefine NSString*
Resource(NSString* name, NSString* folder){
	NSString *folderPath=[AppDir stringByAppendingPathComponent:folder];
	return [folderPath stringByAppendingPathComponent:name];
}

IMIDefine BOOL 
FileExistAt(NSString *filepath)
{
	if(filepath==nil)return NO;
	return [[NSFileManager defaultManager] fileExistsAtPath:filepath];
}

